﻿// --------------------------------------------------------------------------------------
// <copyright file="noi_dungController.cs" company="NGroup">
// Copyright (c) NGroup. All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------
// <history>
//     <change who="Bui Thanh Nam" date="2014.01.05">Create</change>
// </history>
// --------------------------------------------------------------------------------------

namespace NGroup.VTL.Web.Controllers
{
    using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using NGroup.VTL.Models;
using NGroup.VTL.Service;
using NGroup.VTL.Service.Abstraction;

    public class mua_hangController : ContentBaseController
    {
        #region Constructor

        private IRetrieveContentService _retrieveContentService;

        public mua_hangController()
        {
            _retrieveContentService = new RetrieveContentService();
        }

        public mua_hangController(IRetrieveContentService retrieveContentService)
        {
            _retrieveContentService = retrieveContentService;
        }

        #endregion

        [HttpPost]
        public string dat_mua(OrderModel model)
        {
            bool result = false;

            if (ModelState.IsValid)
            {
                result = _retrieveContentService.PlaceOrder(model);
            }
            
            return result.ToString();
        }

    }
}
